str1=str(input(''))
upper=0
lower=0
space=0
digit=0
others=0
for a in str1:
	if a.isspace():
		space+=1
	elif a.isupper():
		upper+=1
	elif a.islower():
		lower+=1
	elif a.isdigit():
		digit+=1
	else:
		others+=1
print('%d %d %d %d %d'%(lower,upper,digit,space,others))